//
//  ContentViewController.m
//  Wangi
//
//  Created by ChuXiang on 15/11/26.
//  Copyright © 2015年 ChuXiang. All rights reserved.
//

#import "ContentViewController.h"

@interface ContentViewController () <UIWebViewDelegate>
@property (nonatomic, retain) UIWebView *webView;
@end

@implementation ContentViewController
- (void)dealloc {
    [super dealloc];
    [_webView release];
}
- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    NSLog(@"%@", _model);
    self.view.backgroundColor = [UIColor whiteColor];
//    self.navigationController.navigationBar.translucent = YES;
    [self.view addSubview:self.webView];
    _webView.delegate = self;
    NSURL *url = [NSURL URLWithString:_model.url_3w];
    NSURLRequest *requst = [NSURLRequest requestWithURL:url];
    [_webView loadRequest:requst];
    [_webView reload];

    [_webView release];
}

- (void)setModel:(BaseModel *)model {
    if (_model != model) {
        [_model release];
        _model = [model retain];
    }
}

- (UIWebView *)webView {
    if (!_webView) {
        self.webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, -150, self.view.frame.size.width, self.view.frame.size.height + 37)];
        _webView.scalesPageToFit = YES;
        [_webView release];
    }
    return _webView;
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
